package org.jks.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.jks.config.Config;
import org.jks.model.ForApply;
import org.jks.service.ForApplyService;
import org.jks.util.JsonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/forapply")
public class ForApplyController {
	@Autowired
	ForApplyService forApplyService;

	@RequestMapping("/detail")
	public ModelAndView detail(HttpServletRequest request, HttpSession session, HttpServletResponse response, Map<String,Object> model){
		try {
			ForApply forApply = forApplyService.first();
			model.put("forApply", JsonUtil.Object2Json(forApply));
		} catch (Exception e) {
			e.printStackTrace();
		}
		Config.init(request, response, session, model);
		return new ModelAndView("wuziMgr/for_apply_detail", model);
	}
}
